<?php $this->load->view('header/standard'); ?>
<div id="main">
    <div class="container">
        <div class="span-17 colborder" id="content">
            <?php if (isset($messages)) echo $messages; ?>

            <div id="submenu-container" class="span-17 last">
                <?php $this->load->view('menu/profile'); ?>
            </div>

            <?php echo form_open('profile/pilot/edit/'.$person->id)?>
                <?php echo ($pilot->leonardo_id)? form_hidden('leonardo_id', $pilot->leonardo_id): ''; ?>
                <div class="span-16 last box">
		            <div class="span-9">
		                <label for="active"><?=lang('profile.Active')?>: </label> 
		                <?php echo form_dropdown('active', array (
		                        1 => lang('profile.Yes'),
		                        0 => lang('profile.No')
		                        ), set_value('active', $pilot->active)); ?>
		                <p>
		                    <label for="sponsor"><?=lang('profile.Sponsor')?>: </label> 
		                    <?php echo form_input('sponsor',set_value('sponsor', $pilot->sponsor), 'size="40"'); ?>
		                </p>
		                <p class="prepend-top">
		                    <label for="comments"><?=lang('profile.Comments')?>: </label> 
		                    <?php echo form_textarea(array('name' => 'comments', 'cols' => '35', 'rows' => '5'),
		                        set_value('comments', $pilot->comments), ' class="span-8"'); ?>
		                </p>
		            </div>
		            <div class="span-6 last">
				        <p>
				            <label for="helmet"><?=lang('profile.Helmet')?>: </label> 
				            <?php echo form_input('helmet',set_value('helmet', $pilot->helmet)); ?>
				        </p>
				        <p>
				            <label for="harness"><?=lang('profile.Harness')?>: </label> 
				            <?php echo form_input('harness',set_value('harness', $pilot->harness)); ?>
				        </p>
				        <p>
				            <label for="rescue"><?=lang('profile.Rescue')?>: </label> 
				            <?php echo form_input('rescue',set_value('rescue', $pilot->rescue)); ?>
				        </p>
                        <p class="prepend-top">
                            <label for="gps"><?=lang('profile.GPS')?>: </label> 
                            <?php echo form_input('gps',set_value('gps', $pilot->gps)); ?>
                        </p>
                        <p>
                            <label for="vario"><?=lang('profile.Vario')?>: </label> 
                            <?php echo form_input('vario',set_value('vario', $pilot->vario)); ?>
                        </p>
		            </div>
                </div>
                <div class="span-16 last form-actions-panel">
                    <p><?php echo form_submit('action',lang('profile.Update')); ?></p>
                </div>
            <?php echo form_close(); ?>
            <?php if (!$pilot->leonardo_id): ?>
            <?php echo form_open('profile/leonardo/import/'.$person->id); ?>
                <div id="" class="span-16 last box">
                    <h4><?=lang('profile.Import_from_Leonardo')?></h4>
                    <p>
                        <label for="leonardo_user"><?=lang('profile.Leonardo_Username')?>: </label> 
                        <?php echo form_input('leonardo_user',set_value('leonardo_user'), 'class="inline"'); ?> &nbsp; 
                    </p>
                    <p>
                        <label for="leonardo_pass"><?=lang('profile.Leonardo_Password')?>: </label> 
                        <?php echo form_password('leonardo_pass',set_value('leonardo_pass'), 'class="inline"'); ?> &nbsp; 
                        <?php echo form_submit('action',lang('profile.Import')); ?>
                    </p>
                </div>
            <?php echo form_close(); ?>
            <?php endif; ?>
        </div> <!-- end content -->
        <div class="span-6 last" id="sidebar">
          <?php $this->load->view('menu/sidebar', array('person' => $person, 'context' => 'pilot'))?>
        </div> <!-- end sidebar -->
    </div> <!-- end container -->
</div> <!-- end main -->
    <script type="text/javascript">
        $(function() {
            $("#datepicker").datepicker({
                dateFormat: 'yy-mm-dd',
                changeMonth: true,
                changeYear: true,
                yearRange: 'c-100:c'
            });
        });
    </script>
<?php $this->load->view('footer/standard');?>
